<!DOCTYPE html>

<html lang='en'>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/react.development16.4.0.js"></script>
    <script src="./lib/react-dom.development16.4.0.js"></script>
    <script src="./lib/babel.min.js"></script>
</head>

<body>
    <div id="app">
    </div>
    <script type="text/babel">
      class Son extends React.Component {
            render() {
                return (
                    <div>
                        <h1>这里是子组件值是：{this.props.svalue}</h1>
                    </div>
                )
            }
        }
        
        class Father extends React.Component {
            constructor(props) {
                super(props);
                this.state={
                    name:'张三'
                }
            }
            render() {
                return (
                    <div>
                        
                        <h1>这里是父组件值是：{this.state.name}</h1>
                        <Son svalue={this.state.name}/>
                    </div>
                )
            }
        }
        
        const el = <Father />
        ReactDOM.render(
            el,document.getElementById('app')
        );
    </script>
</body>

</html>